package com.cmstop.bzgd.ui.activities;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.cmstop.bzgd.R;
import com.cmstop.bzgd.base.BaseActivity;
import com.cmstop.bzgd.ui.fragment.ColumnBaseFragment;
import com.cmstop.bzgd.ui.fragment.CommonHighFragment;
import com.cmstop.bzgd.ui.fragment.HomeCommonFragment;
import com.cmstop.bzgd.ui.utils.TitleUtils;
import com.jiongbull.jlog.JLog;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 书记专区、县长专区 （通用 banner+新闻列表模板）
 */
public class CommonCultureActivity extends BaseActivity {

    @Override
    protected void initInject() {
        setContentView(R.layout.activity_home_project);
        ButterKnife.bind(this);

        ColumnBaseFragment fragment=new CommonHighFragment();
        new TitleUtils(this).useAndSetTxTitle(getIntent().getStringExtra(EX_TITLE));
        fragment.setChannelUrl(getIntent().getStringExtra(EX_URL));
        JLog.i("Log","EX_URL  "+getIntent().getStringExtra(EX_URL));
        addFragmentToActivity(getSupportFragmentManager(), fragment, R.id.frameContent);
    }
    public void addFragmentToActivity(FragmentManager fragmentManager,
                                      Fragment fragment, int frameId) {
        FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.replace(frameId, fragment);
        transaction.commitAllowingStateLoss();
    }

    @OnClick(R.id.title_top_back)
    public void onViewClicked() {
        finish();
    }


}
